package com.hxh.component.business.arouter;
/**
 * Created by hxh on 2017/8/15.
 */

import android.support.v4.app.Fragment;

import com.hxh.component.business.arouter.provider.ILoginActivityProvider;
import com.hxh.component.business.arouter.provider.IMainActivityProvider;
import com.hxh.component.business.arouter.router.MyRouter;
import com.hxh.component.business.arouter.router.ServiceManager;

/**
 * 创建者：hxh
 * 时间：  2017/8/15
 * 描述： 全局管理Router跳转，格式为：
 *  1个跳转类对应provider包下一个路由声明类
 *  然后，在此写入方法，以便轻松进行Router
 *  注意的是： Activity和Fragment写法不同，Fragment
 */
public class MyAppProvider {

    //跳转到mainactivity
    public static Object startMainActivty(String key,String value)
    {
        return MyRouter.newInstance(IMainActivityProvider.KEY)
                .withString(key,value)
                .navigation();
    }

    //跳转到登录页面
    public static Object startLoginActivty(String key,String value)
    {
        return MyRouter.newInstance(ILoginActivityProvider.KEY)
                .withString(key,value)
                .navigation();
    }

    public static Fragment getContractFragment(Object... args)
    {
        return ServiceManager.getInstance().getWorkProvider().newInstance(args);
    }


    public static Fragment getHomeFragment(Object... args)
    {
        return ServiceManager.getInstance().getHomeProvider().newInstance(args);
    }

    public static Fragment getEmployeeFragment(Object... args)
    {
        return ServiceManager.getInstance().getEmployeeProvider().newInstance(args);
    }

    public static Fragment getRecruitFragment(Object... args)
    {
        return ServiceManager.getInstance().getRecruitProvider().newInstance(args);
    }


    //    ========mine==========

    public static Fragment getMineFragment(Object... args)
    {
        return ServiceManager.getInstance().getMineProvider().newInstance(args);
    }


}
